﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for TextAreaTest and is intended
    ///to contain all TextAreaTest Unit Tests
    ///</summary>
    [TestClass()]
    public class TextAreaTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for TextArea Constructor
        ///</summary>
        [TestMethod()]
        public void TextAreaConstructorTest() {
            TextArea target = new TextArea();
            Assert.AreEqual("<textarea></textarea>", target.ToString());
        }

        /// <summary>
        ///A test for AutoFocus
        ///</summary>
        [TestMethod()]
        public void AutoFocusTest() {
            TextArea target = new TextArea();
            bool expected = false;
            bool actual;
            target.AutoFocus = expected;
            actual = target.AutoFocus;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Cols
        ///</summary>
        [TestMethod()]
        public void ColsTest() {
            TextArea target = new TextArea();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.Cols = expected;
            actual = target.Cols;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Disabled
        ///</summary>
        [TestMethod()]
        public void DisabledTest() {
            TextArea target = new TextArea();
            bool expected = false;
            bool actual;
            target.Disabled = expected;
            actual = target.Disabled;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            TextArea target = new TextArea();
            Form expected = new Form();
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for MaxLength
        ///</summary>
        [TestMethod()]
        public void MaxLengthTest() {
            TextArea target = new TextArea();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.MaxLength = expected;
            actual = target.MaxLength;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            TextArea target = new TextArea();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Placeholder
        ///</summary>
        [TestMethod()]
        public void PlaceholderTest() {
            TextArea target = new TextArea();
            string expected = string.Empty;
            string actual;
            target.PlaceHolder = expected;
            actual = target.PlaceHolder;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for ReadOnly
        ///</summary>
        [TestMethod()]
        public void ReadOnlyTest() {
            TextArea target = new TextArea();
            bool expected = false;
            bool actual;
            target.ReadOnly = expected;
            actual = target.ReadOnly;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Required
        ///</summary>
        [TestMethod()]
        public void RequiredTest() {
            TextArea target = new TextArea();
            bool expected = false;
            bool actual;
            target.Required = expected;
            actual = target.Required;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Rows
        ///</summary>
        [TestMethod()]
        public void RowsTest() {
            TextArea target = new TextArea();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.Rows = expected;
            actual = target.Rows;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for SelectionDirection
        ///</summary>
        [TestMethod()]
        public void SelectionDirectionTest() {
            TextArea target = new TextArea();
            string expected = string.Empty;
            string actual;
            target.SelectionDirection = expected;
            actual = target.SelectionDirection;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for SelectionEnd
        ///</summary>
        [TestMethod()]
        public void SelectionEndTest() {
            TextArea target = new TextArea();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.SelectionEnd = expected;
            actual = target.SelectionEnd;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for SelectionStart
        ///</summary>
        [TestMethod()]
        public void SelectionStartTest() {
            TextArea target = new TextArea();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.SelectionStart = expected;
            actual = target.SelectionStart;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Wrap
        ///</summary>
        [TestMethod()]
        public void WrapTest() {
            TextArea target = new TextArea();
            Nullable<TextArea.WrapChoices> expected = TextArea.WrapChoices.Hard;
            Nullable<TextArea.WrapChoices> actual;
            target.Wrap = expected;
            actual = target.Wrap;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            TextArea t = new TextArea();
            t.AutoFocus = true;
            t.Cols = 1;
            t.Disabled = true;
            Form f = new Form();
            f.ID = "formid";
            t.Form = f;
            t.MaxLength = 2;
            t.Name = "name";
            t.PlaceHolder = "placeholder";
            t.ReadOnly = true;
            t.Required = true;
            t.Rows = 3;
            t.SelectionDirection = "sd";
            t.SelectionEnd = 4;
            t.SelectionStart = 5;
            t.Wrap = TextArea.WrapChoices.Hard;
            Assert.AreEqual("<textarea autofocus=\"autofocus\" " +
                "cols=\"1\" " +
                "disabled=\"disabled\" " +
                "form=\"formid\" " +
                "maxlength=\"2\" " +
                "name=\"name\" " +
                "placeholder=\"placeholder\" " +
                "readonly=\"readonly\" " +
                "required=\"required\" " +
                "rows=\"3\" " +
                "selectiondirection=\"sd\" " +
                "selectionend=\"4\" " +
                "selectionstart=\"5\" " +
                "wrap=\"hard\"></textarea>", t.ToString());
        }
    }
}
